{% extends "../templates/ajax/main_content_base.html" %} 
{% block intro %}{% endblock %}
{% block page_name %}homework_list{% endblock %}
{% block content %}


<div class="content-box">
	<div class="content-box-header">
		<h3>{{homework.name}}</h3>

	</div>
	<!-- End .content-box-header -->

	<div class="content-box-content">

		<div class="tab-content default-tab">

			<form id="create-group-form" action="submit_homework" method="post">

				<fieldset>
					<!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->

					<input name="homework_id" type="hidden" value="{{homework.id}}"/>
					<p>
						<label>选择文件</label> <input
							type="file" id="file"
							name="file" />
						<!-- Classes for input-notification: success, error, information, attention -->
						<br />
	
					</p>

					<p>
						<input onclick="$('#file').uploadifyUpload();return false" class="button" type="submit" value="上传" />
					</p>

				</fieldset>

				<div class="clear"></div>
				<!-- End .clear -->

			</form>
		</div>
		<!-- End #tab3 -->

	</div>
	<!-- End .content-box-content -->

</div>
<!-- End .content-box -->
<script type="text/javascript" src="resources/scripts/swfobject.js"></script>
<script type="text/javascript" src="resources/scripts/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">

  $('#file').uploadify({
    'uploader'  : 'resources/scripts/uploadify.swf',
    'script'    : 'submit_homework',
    'cancelImg' : 'resources/images/cancel.png',
    'folder'    : '',
    'auto'      : false,
    'buttonText'  : 'Choose File',
    'scriptData'  : {'homework_id':{{homework.id}},'user_id':'{{request.user.username}}'},
    'fileDataName' :'file',
    'onAllComplete' : function(event,data) {
    	$('#main-content').load('show_submited_homework?homework={{homework.id}}');
      }
  });
  

</script>
{% endblock %}
